@use "sass:math";

.preview {
	cursor: default;

	header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 4px 8px;
		border-bottom: 1px solid var(--fill-quinary);
		line-height: rem(12);
		white-space: nowrap;
		user-select: none;

		.start,
		.center,
		.end {
			flex: 1 1 0;
			display: flex;
			align-items: center;
		}

		.center {
			flex: 0 1 auto;
			justify-content: center;
			min-width: 0;
			max-width: 50%;
		}

		.end {
			justify-content: flex-end;
		}

		.icon {
			margin-inline-end: 5px;
		}

		.page {
			display: flex;
			align-items: center;
			font-weight: bold;
			padding-right: 8px;

			> div:first-child {
				margin-right: math.div(4em, 11);
			}
		}

		.author {
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
			color: var(--fill-secondary);
			margin-inline-end: 4px;

			&.non-authoritative {
				opacity: 0.4;
			}
		}

		.custom-sections {
			display: flex;
			padding: 0 3px;
			gap: 3px;
		}
	}

	.text {
		color: var(--fill-secondary);
		position: relative;

		&:last-child {
			border-bottom: 0;

			.selected & {
				border-bottom: 0;
			}
		}

		.blockquote-border {
			position: absolute;
			left: 8px;
			top: nem(4);
			bottom: nem(5);
			width: 2px;
			z-index: 1;
		}

		.content {
			padding-left: 16px;
		}
	}

	.comment {
		border-bottom: 1px solid var(--fill-quinary);

		&:last-child {
			border-bottom: 0;

			.selected & {
				border-bottom: 0;
			}
		}
	}

	.image {
		width: 100%;
		@include pdf-page-image-dark-light;
	}

	.tags {
		width: 100%;
		text-align: left;
		padding: rem(3) 8px rem(5);

		// Normalize line height across browsers at 11px font-size
		line-height: 1.37;
		word-break: break-word;

		@-moz-document url-prefix() {
			padding: rem(4) 8px rem(4);
		}

		.tag {
			&::after {
				content: ", ";
				color: #000; /* replaced $text-color */
			}

			&:last-child {
				&::after {
					content: none;
				}
			}
		}

		&:empty::before {
			content: attr(placeholder);
			color: #6d95e0; /* replaced $tags-placeholder-color */

			.annotation-popup & {
				color: #707070;
			}
		}
	}
}
